import { createRouter, createWebHashHistory } from 'vue-router'
//引入页面组件
import Index from '~/pages/index.vue'

const routes = [
    {
        path: '/',
        component: Index
    },
    {
        path: '/about',
        component: () => import('~/pages/about.vue')
    },
    {
        path: '/login',
        component: () => import('~/pages/login.vue')
    },
    {
        path: '/:pathMatch(.*)*',
        component: () => import('~/pages/404.vue')
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router